package com.itzb.asone.application;

import java.io.Serializable;
import java.util.Map;

import com.itzb.asone.system.model.SysGroup;
import com.itzb.asone.system.model.SysUser;
import com.itzb.asone.system.service.ISysDictService;
import com.itzb.asone.utils.SpringContextUtil;

public class ApplicationUserInfo implements Serializable {
	
	private ISysDictService sysDictService = SpringContextUtil.getBean("sysDictService");
	

	public ApplicationUserInfo(SysUser sysUser,SysGroup sysGroup) {
		super();
		Map<String,Object> map = sysDictService.translateToMap(sysUser);
		this.userId = map.get("id")==null?"": map.get("id").toString();
		this.userName = map.get("userName")==null?"": map.get("userName").toString();
		this.realName = map.get("realName")==null?"": map.get("realName").toString();
		this.orgCode = map.get("orgCode")==null?"": map.get("orgCode").toString();
		this.orgName= map.get("orgName")==null?"": map.get("orgName").toString();
		this.headImg= map.get("headImgUrl")==null?"": map.get("headImgUrl").toString();
		if(sysGroup != null){
			this.groupId = sysGroup.getId();
			this.groupName = sysGroup.getGroupName();
		}
	}


	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	public String getOrgName()
	{
		return orgName;
	}

	public void setOrgName(String orgName)
	{
		this.orgName = orgName;
	}
	
	public String getHeadImg() {
		return headImg;
	}

	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getRealName() {
		return realName;
	}


	public void setRealName(String realName) {
		this.realName = realName;
	}

	private static final long serialVersionUID = 4285121088182546669L;

	private String userId;

	private String userName;
	
	private String realName;

	private String orgCode;
	
	private String orgName;
	
	private String headImg;
	
	private String groupName;
	
	private String groupId;


}